/***********************************************
 This file is part of redia-bapps-main-ios.
 
 Copyright (c) 2015 Redia A/S
 
 Redia-bapps-main-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 Redia-bapps-main-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-bapps-main-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */

//
//  BAAddReservationViewController.m
//  redia-bapps-ios
//
//  Created by Henrik Lynbech on 18/08/13.
//  Copyright (c) 2013 redia. All rights reserved.
//

#import "BABlackCoverDialogViewController.h"
#import "BARootViewController.h"

@interface BABlackCoverDialogViewController () {
}

@end

@implementation BABlackCoverDialogViewController

+(id)createBlackCoverDialog
{
    BABlackCoverDialogViewController* new_dialog_viewcontroller = [[self alloc] initWithNibName:@"BABlackCoverDialogViewController" bundle:[NSBundle mainBundle]];
    
    BARootViewController* rootviewController = [BARootViewController instance];

    [rootviewController addChildViewController:new_dialog_viewcontroller];
    [rootviewController.view addSubview:new_dialog_viewcontroller.view];
    new_dialog_viewcontroller.view.translatesAutoresizingMaskIntoConstraints = NO;
    
    [rootviewController.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[view]|" options:0 metrics: 0 views:@{@"view": new_dialog_viewcontroller.view}]];
    [rootviewController.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[view]|" options:0 metrics: 0 views:@{@"view": new_dialog_viewcontroller.view}]];
    
    //FIXME: impl animations
    
    return new_dialog_viewcontroller;
}

-(void)dismissBlackCover
{
    [self.view removeFromSuperview];
    [self removeFromParentViewController];

}
@end
